package com.cskaoyan.wordmemorize.controller.app;

import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dto.admin.GoodsDTO;
import com.cskaoyan.wordmemorize.dto.admin.PageDTO;
import com.cskaoyan.wordmemorize.request.GoodsPageRequest;
import com.cskaoyan.wordmemorize.service.GoodsService;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserGoodsController {

    @Autowired
    GoodsService goodsService;

    @GetMapping("product")
    public Result<PageDTO<GoodsDTO>> getGoodsPage(GoodsPageRequest request){
        PageDTO<GoodsDTO> goodsPage = goodsService.getGoodsPage(request);
        return Result.ok(goodsPage);
    }
}
